package com.my.test.thread.conditition;

public class Product extends Thread {


    @Override
    public void run() {
        MyQueue queue = TestMyQueue.myQueue;
        System.out.println("队列里数组长度："+queue.getItems().length);
        int i = 0;
        while (true) {
            try {
                i++;
                queue.add("data" + i);
                System.out.println("生产："+"data" + i);
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
